var passwordin = '';
var app = getApp();
Page({
  data:{
    
  },
  onLoad:function(options){
    // 页面初始化 options为页面跳转所带来的参数
    
  },
  onReady:function(){
    // 页面渲染完成
    
  },
  onShow:function(){
    // 页面显示
    
  },
  onHide:function(){
    // 页面隐藏
    
  },
  onUnload:function(){
    // 页面关闭
    
  },
  back:function(){
      console.log("back");
      wx.navigateBack({
          delta:1
      });
  },
  confirm:function(){
    
    wx.request({
            url: 'https://cd.tunnel.litelink.me/v1/smallapp/adminPasswd',
            data:{
              password:passwordin,
              sn:app.globalData.SN
            },
            method:'GET',
            header:{
                "Content-Type":"application/json"
            },
            success: function(res) {
                if(res.data == "ok"){
                   wx.showToast({
                    title: '已修改',
                    icon: 'success',
                    duration: 2000
                  })
                  
                }else{
                 wx.showToast({
                    title: '修改失败',
                    duration: 2000
                  })
                }
            }
    });
    console.log(passwordin)
  },
  bindKeyInput: function(e) {    
    passwordin = e.detail.value
  },
})